package com.supermap.dubbo.api.disaster;


import com.supermap.dataservice.util.Table;
import com.supermap.dubbo.api.disaster.entity.DisasterComment;
import com.supermap.dubbo.api.disaster.entity.Disasterpraise;
import com.supermap.dataservice.util.JSONUtil;

/**
 * @author lxs
 * @Title:灾害种类业务层
 * @Description:
 * @date 2018/3/1  15:19
 */
public interface DisasterTypeService {
    /**
     * 查询全部灾害种类,type=1 时查询自然灾害，type＝2时查询病虫害
     * @return
     */
    JSONUtil getAllDisasterType(int levels,String type);

    /**
     * 根据灾情ID得到所有的点赞数
     * @param disasterId
     * @return
     */
    int getDisasterPraiseCount(int disasterId);

    /**
     * 判断该用户是否对该灾情点过赞
     * @param userId
     * @param disasterId
     * @return
     */
    boolean getDisasterPraise(int userId, int disasterId);

    /**
     * 添加点赞
     * @param disasterpraise
     * @return
     */
    boolean addDisasterPraise(Disasterpraise disasterpraise);

    /**
     * 添加评论
     * @param disasterComment
     * @return
     */
    boolean addDisasterComment(DisasterComment disasterComment, String uid);

    /**
     * 根据灾害ID得到对应所有的评论（树形结构）
     * @param disasterId
     * @return
     */
    JSONUtil getAllDisasterCommentByagrInfoId(int disasterId);

    /**
     * 根据userId获取该灾情的评论及相关信息 分页
     * @param table
     * @param userId
     * @param areaCode
     * @return
     */
    JSONUtil getDisAllInfoByUserorAreaCode(Table table,String userId,String areaCode);
}
